package metalink.admin;
import com.opensymphony.xwork2.ActionSupport;
import java.util.*;
import java.sql.*;
import vo.*;
import vo.mixed.*;
import model.admin.*;
import myutil.*;


public class DeleteStaffDetails extends ActionSupport{
int[] staff_id;


	public int[] getStaff_id() {
	return staff_id;
}
public void setStaff_id(int[] staff_id) {
	this.staff_id = staff_id;
}

	public String execute(){
		try{
			Connect c=new Connect();
			for(int single_staff_id:staff_id){
				String email_id="";
				ResultSet rs=c.getResult("select email_id from college_staff where staff_id='"+single_staff_id+"'");
				if(rs.next()){
					email_id=rs.getString("email_id");
				}
				c.dml("delete from college_staff where staff_id='"+single_staff_id+"'");
				
				c.dml("delete from login_info where login_id='"+email_id+"'");
			}
			
				
			
			return SUCCESS;
		}
		
		catch(Exception e){
			e.printStackTrace();
			return ERROR;
		}
	}
}
